<template>
	<view class="cart">
		<index-header  color="#2a7a5a" title="购物车" :hassearch="false"></index-header>
		<view class="cart-actionbar">
			<view class="title">
				共2个商品
			</view>
			<view class="button">
				管理
			</view>
		</view>
		<view class="cart-list">
			<view class="cart-list-item">
				<view class="selector">
					<view class="button" @click="selectItem()">
					</view>
					<view class="selected" @click="selectItem()">
					</view>
				</view>
				<view class="image">
					<image src="../../../static/uploadfiles/shaobing.jpg" mode=""></image>
				</view>
				<view class="info">
					<view class="title">
						黄山烧饼
					</view>
					<view class="tag">
						咸香味
					</view>
					<view class="sells">
						月售200份
					</view>
					<view class="price">
						<view class="price-now">
							￥26
						</view>
						<view class="price-num">
							<view class="button minus" @click="minus">-</view>
							<view class="num">
								{{num}}
							</view>
							<view class="button add" @click="add">
								+
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="cart-list">
			<view class="cart-list-item">
				<view class="selector">
					<view class="button" @click="selectItem()">
					</view>
					<view class="selected" @click="selectItem()">
					</view>
				</view>
				<view class="image">
					<image src="../../../static/uploadfiles/shaobing.jpg" mode=""></image>
				</view>
				<view class="info">
					<view class="title">
						黄山烧饼
					</view>
					<view class="tag">
						咸香味
					</view>
					<view class="sells">
						月售200份
					</view>
					<view class="price">
						<view class="price-now">
							￥26
						</view>
						<view class="price-num">
							<view class="button minus" @click="minus">-</view>
							<view class="num">
								{{num}}
							</view>
							<view class="button add" @click="add">
								+
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="cart-recommend">
			<view class="cart-recommend-title">
				<view class="hr">
					
				</view>
				<view class="title">
					<view class="title-icon">
						<image src="../../../static/icon/thumb.svg" mode=""></image>
					</view>
					<view class="title-text">
						为您推荐
					</view>
				</view>
				<view class="hr">
					
				</view>
			</view>
			<view class="cart-recommend-list">
				<view class="cart-recommend-item">
					<image src="../../../static/uploadfiles/gongbaojiding.jpg" mode=""></image>
				</view>
				<view class="cart-recommend-item">
					<image src="../../../static/uploadfiles/gongbaojiding.jpg" mode=""></image>
				</view>
				<view class="cart-recommend-item">
					<image src="../../../static/uploadfiles/gongbaojiding.jpg" mode=""></image>
				</view>
				<view class="cart-recommend-item">
					<image src="../../../static/uploadfiles/gongbaojiding.jpg" mode=""></image>
				</view>
			</view>
		</view>
		<view class="fakefooter">
			
		</view>
		<cart-bar></cart-bar>
	</view>
</template>

<script>
	import indexHeader from '../../../components/indexHeader.vue'
	import cartBar from '../../../components/cartBar.vue'
	export default {
		components: {
			indexHeader,
			cartBar
		},
		data() {
			return {
				num: 0
			}
		},
		methods: {
			add() {
				this.num++
			},
			minus() {
				this.num--
			}
		}
	}
</script>

<style lang="scss">
.cart {
	margin-top: 180rpx;
	&-actionbar {
		display: flex;
		justify-content: space-between;
		border-bottom: #eee solid 1px;
		height: 50rpx;
		color: #2a7a5a;
		.title {
			font-size: 28rpx;
			margin-left: 40rpx;
		}
		.button {
			font-size: 28rpx;
			margin-right: 40rpx;
		}
	}
	&-list {
		margin-top: 20rpx;
		&-item {
			display: flex;
			justify-content: space-around;
			margin-bottom: 50rpx;
			.selector {
				width: 100rpx;
				height: 250rpx;
				.button {
					width: 60rpx;
					height: 60rpx;
					margin: 95rpx auto;
					border-radius: 50%;
					border: #2a7a5a 1px solid;
				}
			}
			.image {
				width: 250rpx;
				height: 250rpx;
				border-radius: 20rpx;
				overflow: hidden;
				image {
					width: 100%;
					height: 100%;
				}
			}
			.info {
				width: 300rpx;
				display: flex;
				flex-direction: column;
				.title {
					font-size: 40rpx;
					font-weight: bold;
					color: #505050;
				}
				.tag {
					font-size: 20rpx;
					width: 100rpx;
					height: 30rpx;
					line-height: 30rpx;
					background-color: #f1f1f1;
					text-align: center;
					margin-top: 40rpx;
				}
				.sells {
					font-size: 20rpx;
					margin-top: 40rpx;
				}
				.price {
					display: flex;
					margin-top: 20rpx;
					justify-content: space-between;
					&-now {
						font-size: 36rpx;
						color: #012816;
					}
					&-num {
						display: flex;
						margin-right: 20rpx;
						.button {
							width: 50rpx;
							height: 50rpx;
							text-align: center;
							color: #fff;
							border-radius: 5rpx;
						}
						.num {
							width: 50rpx;
							height: 50rpx;
							line-height: 50rpx;
							text-align: center;
							color: #a6a6a6;
							font-size: 30rpx;
						}
						.add {
							background-color: #2c8066;
						}
						.minus {
							background-color: #e5e5e5;
						}
					}
				}
			}
		}
	}
	&-recommend {
		margin-top: 20rpx;
		&-title {
			display: flex;
			justify-content: center;
			height: 60rpx;
			.hr {
				width: 100rpx;
				height: 2rpx;
				margin: 29rpx 20rpx;
				background-color: #2c8066;
			}
			.title {
				width: 240rpx;
				display: flex;
				justify-content: space-around;
				&-icon {
					width: 60rpx;
					height: 60rpx;
					image {
						width: 100%;
						height: 100%;
					}
				}
				&-text {
					font-size: 40rpx;
					line-height: 60rpx;
					color: #2c8066;
				}
			}
		}
		&-list {
			margin-top: 20rpx;
			display: flex;
			justify-content: space-around;
			flex-wrap:wrap;
		}
		&-item {
			width: 300rpx;
			height: 400rpx;
			overflow: hidden;
			border-radius: 40rpx;
			margin-bottom: 40rpx;
			image {
				width: 100%;
				height: 100%;
			}
		}
	}
}
.fakefooter {
	width: 100%;
	height: 150rpx;
}
</style>
